<template>
  <!-- 主要区域开始 -->
  <div class="main-container">
    <!-- 单一内容开始 -->
    <div class="know-item">
      <!-- 内容容器开始 -->
      <div class="content">
        <!-- 标题开始 -->
        <!-- @click="router.push(`/home/detail`)" -->
        <div class="title-content">
          <div class="title" >
            {{ know.n_title }}
          </div>
        </div>
        <!-- 标题结束 -->
        <!-- 医师信息开始 -->
        <div class="message">
          <span>{{ know.n_time }}</span>&nbsp;
          <span>江苏省人民医院</span>
        </div>
        <!-- 医师信息结束 -->
      </div>
      <!-- 内容容器结束 -->
      <!-- 图片开始 -->
      <div class="image">
        <img :src="know.n_img" />
      </div>
      <!-- 图片结束 -->
    </div>
    <!-- 单一内容结束 -->
  </div>
  <!-- 主要区域结束 -->
</template>

<script setup lang="ts">
import Know from '@/type/Know';

const props = defineProps<{know:Know}>()
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.main-container {
  background-color: #fff;
}
.know-item {
  margin: 10px;
  background-color: #fff;
  border-bottom: 1px solid #e2e2e2;
  display: flex;
}
.image {
  width: 160px;
  height: 90px;
  position: relative;
  float: right;
}
.image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
.content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 90px;
  max-height: 90px;
  width: calc(100% - 160px);
  position: relative;
}

.title-content .title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-height: 52px;
  line-height: 26px;
  font-size: 17px;
  text-align: left;
}
.message {
  max-height: 26px;
  line-height: 26px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.message span {
  font-size: 12px;
  color: #acabb1;
}
</style>
